<template>
	<view class="zxTcIntroPop">
		<view class="tcIntroPopTit">{{tcItem.tcName}}</view>
		<view class="tcIntroCon">
			<scroll-view class="tcIntroScroll" scroll-y>
				{{tcItem.tcProfile}}
			</scroll-view>
		</view>
		<view class="introTcPrice spaceBet">
			<view class="tcMoneyBox hasFlex">
				<text class="hjTxt">合计：</text>
				<text class="tcUnit">¥</text>
				<view class="tcMoney">
					<template v-if="formatTcMoneyLen(tcItem.tcMoney) == 1">
						{{tcItem.tcMoney}}
					</template>
					<template v-else>
						<text>{{formatTcMoney(tcItem.tcMoney)[0]}}</text>
						<text class="smTcMoney">.{{formatTcMoney(tcItem.tcMoney)[1]}}</text>
					</template>
				</view>
			</view>
			<view class="tcBuyBtn" @tap="goBuyZxTc">去购买</view>
		</view>
	</view>
</template>

<script>
	import { addTeaZxTcOrder } from '@/api/xlzx/index'
	export default {
		props:{
			tcItem:Object
		},
		computed:{
			formatTcMoneyLen(){
				return function(tcMoney){
					let len = String(tcMoney).split(".").length;
					return len;
				}
			},
			formatTcMoney(){
				return function(tcMoney){
					let moneyArr = String(tcMoney).split(".");
					return moneyArr;
				}
			}
		},
		methods:{
			goBuyZxTc(){
				this.$emit("goBuyZxTc",this.tcItem.id)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.zxTcIntroPop{
		border-radius: 40rpx 40rpx 0 0;
		background: #fff;
		padding:30rpx 20rpx;
		height: 800rpx;
		.tcIntroPopTit{
			height: 120rpx;
			font-size: 36rpx;
			color: #000;
			font-weight: 600;
			display: flex;
			align-items: center;
			border-bottom: 1rpx solid #E3E3E3;
			margin-bottom: 20rpx;
		}
		.tcIntroCon{
			font-size: 28rpx;
			color: #666;
			height: calc(100% - 220rpx);
			.tcIntroScroll{
				height: 100%;
			}
		}
		.introTcPrice{
			height: 120rpx;
			border-top: 1rpx solid #E3E3E3;
			align-items: center;
			.tcMoneyBox{
				color: #F75855;
				font-weight: 600;
				font-size: 48rpx;
				display: flex;
				align-items: center;
				.hjTxt{
					font-size: 26rpx;
					color:$pss-text-color3;
					font-weight: normal;
				}
				.tcUnit{
					font-weight: normal;
					font-size: 26rpx;
					margin-right: 5rpx;
				}
				.tcMoney{
					font-family: $sqFontSta;
					.smTcMoney{
						font-size: 32rpx;
						margin-left: 5rpx;
					}
				}
			}
			.tcBuyBtn{
				width: 200rpx;
				height: 70rpx;
				line-height: 70rpx;
				background: #02C396;
				border-radius: 50rpx;
				color: #fff;
				text-align: center;
				font-size:28rpx;
				flex-shrink: 0;
				margin-left: 20rpx;
			}
		}
	}
</style>